﻿using AutoScaleHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tool
{
    public partial class Login : Form
    {
        AutoScale autoScale = new AutoScale();

        private bool _isLoaded = false;
        public Login()
        {
            InitializeComponent();
            autoScale.SetContainer(this);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void Login_Load(object sender, EventArgs e)
        {
            _isLoaded = true;
        }

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            if (_isLoaded) 
            {
                this.SuspendLayout();
                autoScale.UpdateControlsLayout();
                this.ResumeLayout();
            }
        
        }
    }
}
